<script setup lang="ts">
import config from "../../config/index.js";
const bgImg =
  "https://fuyue-test-oss.oss-cn-shanghai.aliyuncs.com/fee67d34-9269-428d-aa75-3b0f46879aac.png";

// const props = defineProps(['fixed', 'title', 'back'])
const props = defineProps({
  fixed: {
    // 是否定在顶部
    type: Boolean,
    default: false,
    required: false, // 是否必传
  },
  title: {
    // 标题
    type: String,
    default: "",
    required: false, // 是否必传
  },
  back: {
    // 是否显示返回
    type: Boolean,
    default: true,
    required: false, // 是否必传
  },
});

//console.log("fixed", !props.fixed);
const handleBack = () => {
  // 返回一页
  uni.navigateBack({ delta: 1 });
};
</script>
<template>
  <uv-navbar
    titleStyle="color:#ffffff"
    leftIcon=""
    leftIconColor="#ffffff"
    :fixed="fixed"
    :title="title || ''"
    bgColor="#C33F29"
  >
    <template v-slot:left>
      <view>
        <uv-icon
          name="arrow-left"
          color="#ffffff"
          v-if="back"
          @click="handleBack"
        ></uv-icon>
      </view>
    </template>
  </uv-navbar>
  <!-- <view class="bg">
        <image :src="config.underlay"></image>
    </view> -->
</template>
<style scoped lang="scss">
.bg {
  position: absolute;
  width: 100%;
  height: 600rpx;

  image {
    width: 100%;
    height: 100%;
  }
}
</style>
